#!/usr/bin/env python
# coding=utf-8

from flask import Blueprint

from plant.base.beanret import BeanRet
from plant.service.osinfosv import OSInfoSV

pitop = Blueprint('ip', __name__)


@pitop.route('/ip/read')
def read():
    osinfo = OSInfoSV()
    eth0, wlan0 = osinfo.getIp()
    osVersion = osinfo.getOSInfo()
    return BeanRet(success=True, data={"eth0": eth0, "wlan0": wlan0, "osVersion": osVersion}).toJson()
